package com.qzct.mapper;

import com.mybatisflex.core.BaseMapper;
import com.qzct.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 *  映射层。
 *
 * @author 闽闽
 * @since 2024-12-07
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Select("select * from tb_user where username=#{username} and password = #{password}")

    User login(@Param("username") String username,@Param("password") String password);

    @Select("select uid from tb_user where email = #{mail}")
    Integer getid(@Param("mail") String mail);

    @Update("UPDATE tb_user set password = '111' where uid = #{id}")
    void updatePwd(@Param("id") int id);
}
